package com.dzx.permissionmanagersystem.config;

import com.dzx.permissionmanagersystem.exception.ExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;

@Configuration
public class ExceptionResolverConfig {



    @Bean
    public HandlerExceptionResolver exceptionResolver(){
        return new ExceptionHandler();
    }

    @Bean("jsonView")
    public View jsonView(){
       return new MappingJackson2JsonView();
    }
}
